Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handling of buffer slices #2541

Merged
merged 1 commit into from
Aug 16, 2024
Merged

fix handling of buffer slices #2541

merged 1 commit into from
Aug 16, 2024

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Aug 16, 2024

Our implementation was wrong by assuming the second parameter of utf8Slice() was the length. The correct implementation was: utf8Slice(start, end) where start and end represents the index.

This makes the implementation correct and in par with Node.js' implementations.

Fixes #2538

@anonrig anonrig requested a review from jasnell August 16, 2024 14:43
@anonrig anonrig requested review from a team as code owners August 16, 2024 14:43
@anonrig anonrig requested a review from dom96 August 16, 2024 14:43
@anonrig anonrig merged commit a61bb30 into main Aug 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buffer.prototype.asciiSlice, etc use offset, length instead of start, end
3 participants